<?php include _include(ADMIN_PATH.'view/htm/header.inc.htm');?>

<div class="row">
	<div class="col-lg-8 offset-lg-2">
		<div class="btn-group m-b-1" role="group">
			<?php echo admin_tab_active($menu['user']['tab'], 'list');?>
		</div>
		<div class="card">
			<div class="card-block">
				<h4 class="card-title">编辑费率</h4>
				<form action="<?php echo url('user-rate-'.$_uid);?>" method="post" id="form">
					<div class="form-group row">
						<label class="col-sm-2 form-control-label">用户名：</label>
						<div class="col-sm-10"><?php echo $_user['username'];?></div>
					</div>
					<div class="form-group row">
						<label class="col-sm-2 form-control-label">用户组：</label>
						<div class="col-sm-10">
						<?php
						if($_user['is_proxy']==1){
							echo '代理';
						}elseif($_user['is_admin']==1){
							echo '管理员';
						}elseif($_user['is_open']==0){
							echo '待审核';
						}else{
							echo '商户';
						}
						?></div>
					</div>
					<div class="form-group row">
						<label class="col-sm-2 form-control-label">费率：</label>
						<div class="col-sm-10">
							<input type="text" id="rate" name="rate" class="form-control" value="<?php echo $_user['rate'];?>"><?php echo $rate_note;?>
						</div>
					</div>
					<div class="form-group row">
						<label class="col-sm-2 form-control-label"></label>
						<div class="col-sm-10">
							<button type="submit" class="btn btn-primary btn-block" id="submit">提交修改</button>
							<a role="button" class="btn btn-secondary btn-block m-t-1" href="javascript:history.back();">返回</a>
						</div>
					</div>
				</form>
			</div>
		</div>
	</div>
</div>

<?php include _include(ADMIN_PATH.'view/htm/footer.inc.htm');?>


<script>

var jform = $('#form');
$('#submit').click(function(){
	var postdata = jform.serialize();
	$.xpost(jform.attr('action'), postdata, function(code, message){
		$.alert(message);
		if(code==1) setTimeout(function(){window.location.reload()},1500);
	});
	return false;
});

$('#nav_pc li.user, #nav_mobile li.user').tab('show');
</script>